<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@ page import="java.sql.*" %>
    <%@ page import="javax.servlet.*" %>
<%@ page import="javax.servlet.http.*" %>
<%@ page import="java.sql.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Form 231</title>
<style>
body { font-size: 70%; font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; }
ul#tabs { list-style-type: none; margin: 15px 0 0 0; padding: 0 0 0.1em 0; }
ul#tabs li { display: inline; }
ul#tabs li a { color: #42454a; background-color: #dedbde; border: 1px solid #c9c3ba; border-bottom: none; padding: 0.3em; text-decoration: none; }
ul#tabs li a:hover { background-color: #f1f0ee; }
ul#tabs li a.selected { color: #000; background-color: #f1f0ee; font-weight: bold; padding: 0.7em 0.3em 0.38em 0.3em; }
div.tabContent { border: 1px solid #c9c3ba; padding: 0.5em; background-color: #f1f0ee; }
div.tabContent.hide { display: none; }
</style>

<script type="text/javascript">
var tabLinks = new Array();
var contentDivs = new Array();

function init() {

    // Grab the tab links and content divs from the page
    var tabListItems = document.getElementById('tabs').childNodes;
    for ( var i = 0; i < tabListItems.length; i++ ) {
      if ( tabListItems[i].nodeName == "LI" ) {
        var tabLink = getFirstChildWithTagName( tabListItems[i], 'A' );
        var id = getHash( tabLink.getAttribute('href') );
        tabLinks[id] = tabLink;
        contentDivs[id] = document.getElementById( id );
      }
    }

    // Assign onclick events to the tab links, and
    // highlight the first tab
    var i = 0;

    for ( var id in tabLinks ) {
      tabLinks[id].onclick = showTab;
      tabLinks[id].onfocus = function() { this.blur() };
      if ( i == 0 ) tabLinks[id].className = 'selected';
      i++;
    }

    // Hide all content divs except the first
    var i = 0;

    for ( var id in contentDivs ) {
      if ( i != 0 ) contentDivs[id].className = 'tabContent hide';
      i++;
    }
  }


function showTab() {
    var selectedId = getHash( this.getAttribute('href') );

    // Highlight the selected tab, and dim all others.
    // Also show the selected content div, and hide all others.
    for ( var id in contentDivs ) {
      if ( id == selectedId ) {
        tabLinks[id].className = 'selected';
        contentDivs[id].className = 'tabContent';
      } else {
        tabLinks[id].className = '';
        contentDivs[id].className = 'tabContent hide';
      }
    }

    // Stop the browser following the link
    return false;
  }
  
function getFirstChildWithTagName( element, tagName ) {
    for ( var i = 0; i < element.childNodes.length; i++ ) {
      if ( element.childNodes[i].nodeName == tagName ) return element.childNodes[i];
    }
  }
  
function getHash( url ) {
    var hashPos = url.lastIndexOf ( '#' );
    return url.substring( hashPos + 1 );
  }
  
 /* function addrow()
{
	  var table=document.getElementById("mytable");
	  var row=table.insertRow(1);
	  var cell1=row.insertCell(0);
	  var cell2=row.insertCell(1);
	  var cell3=row.insertCell(2);*/
	  
	 /* cell1.innerHTML = "NEW CELL1";
	  cell2.innerHTML = "NEW CELL2";
	  cell3.innerHTML = "NEW CELL3";*/

 /* }
  function myDeleteFunction() {
	    document.getElementById("myTable").deleteRow(0);
	}
*/

/*
function addRow(id){
var tbody = document.getElementById(id).getElementsByTagName("tbody")[0];
var row = document.createElement("tr");
var data1 = document.createElement("td");
data1.appendChild(document.createTextNode("Column1"));
var data2 = document.createElement("td");
data2.appendChild (document.createTextNode("Column2"));
row.appendChild(data1);
row.appendChild(data2);
tbody.appendChild(row);
*/


var count = "1";
function addRow(in_tbl_name)
{
  var tbody = document.getElementById(in_tbl_name).getElementsByTagName("TBODY")[0];
  // create row
  var row = document.createElement("TR");
  // create table cell 1
  var td1 = document.createElement("TD");
  var strHtml1 = "<FONT SIZE=\"+3\">*</FONT>";
  td1.innerHTML = strHtml1.replace(/!count!/g,count);
  // create table cell 2
  var td2 = document.createElement("TD");
  var strHtml2 = "<SELECT NAME=\"Category\"><OPTION VALUE=\"\"><OPTION VALUE=\"Cat\">1.0</OPTION><OPTION VALUE=\"cat1\">1.5</OPTION><OPTION VALUE=\"cat2\">2.0</OPTION><OPTION VALUE=\"cat3\">3.0</OPTION><OPTION VALUE=\"cat4\">4.0</OPTION><OPTION VALUE=\"cat5\">5.0</OPTION><OPTION VALUE=\"cat6\">8.0</OPTION><OPTION VALUE=\"cat7\">12.0</OPTION><OPTION VALUE=\"cat8\">20.0</OPTION><OPTION VALUE=\"cat9\">21.0</OPTION><OPTION VALUE=\"cat10\">23.0</OPTION><OPTION VALUE=\"cat11\">24.0</OPTION><OPTION VALUE=\"cat12\">25.0</OPTION><OPTION VALUE=\"cat13\">26.0</OPTION><OPTION VALUE=\"cat14\">27.0</OPTION><OPTION VALUE=\"cat15\">28.0</OPTION><OPTION VALUE=\"cat16\">29.0</OPTION><OPTION VALUE=\"cat17\">30.0</OPTION><OPTION VALUE=\"cat18\">31.0</OPTION><OPTION VALUE=\"cat19\">34.0</OPTION><OPTION VALUE=\"cat20\">40.0</OPTION><OPTION VALUE=\"cat21\">50.0</OPTION></SELECT>";
  td2.innerHTML = strHtml2.replace(/!count!/g,count);
 
  var td3 = document.createElement("TD");
  var strHtml3 = "<INPUT TYPE=\"text\" NAME=\"in_name\" SIZE=\"30\" MAXLENGTH=\"30\"  STYLE=\"height:24;border: 1 solid;margin:0;\">";
  td3.innerHTML = strHtml3.replace(/!count!/g,count);
  // create table cell 4
  var td4 = document.createElement("TD");
  var strHtml4 = "<INPUT TYPE=\"text\" NAME=\"in_name\" SIZE=\"30\" MAXLENGTH=\"30\"  STYLE=\"height:24;border: 1 solid;margin:0;\" >";
  td4.innerHTML = strHtml4.replace(/!count!/g,count);
  // create table cell 5
  var td5 = document.createElement("TD");
  var strHtml5 = "<INPUT TYPE=\"Button\" CLASS=\"Button\" onClick=\"delRow()\" VALUE=\"Delete Row\">";
  td5.innerHTML = strHtml5.replace(/!count!/g,count);
  // append data to row
  row.appendChild(td1);
  row.appendChild(td2);
  row.appendChild(td3);
  row.appendChild(td4);
  row.appendChild(td5);
  // add to count variable
  count = parseInt(count) + 1;
  // append row to table
  tbody.appendChild(row);
}

function delRow()
{
  var current = window.event.srcElement;
  //here we will delete the line
  while ( (current = current.parentElement)  && current.tagName !="TR");
       current.parentElement.removeChild(current);
}


function addRow0(in_tbl_name)
{
  var tbody = document.getElementById(in_tbl_name).getElementsByTagName("TBODY")[0];
  // create row
  var row = document.createElement("TR");
  // create table cell 1
  var td1 = document.createElement("TD");
  var strHtml1 = "<FONT SIZE=\"+3\">*</FONT>";
  td1.innerHTML = strHtml1.replace(/!count!/g,count);
  // create table cell 2
  var td2 = document.createElement("TD");
  var strHtml2 = "<SELECT NAME=\"Category\"><OPTION VALUE=\"Cat\"><OPTION VALUE=\"Cat\">1.0</OPTION><OPTION VALUE=\"Dog\">1.5</OPTION><OPTION VALUE=\"Mouse\">2.0</OPTION><OPTION VALUE=\"Mouse\">3.0</OPTION><OPTION VALUE=\"Mouse\">4.0</OPTION><OPTION VALUE=\"Mouse\">5.0</OPTION><OPTION VALUE=\"Mouse\">8.0</OPTION><OPTION VALUE=\"Mouse\">12.0</OPTION><OPTION VALUE=\"Mouse\">20.0</OPTION><OPTION VALUE=\"Mouse\">21.0</OPTION><OPTION VALUE=\"Mouse\">23.0</OPTION><OPTION VALUE=\"Mouse\">24.0</OPTION><OPTION VALUE=\"Mouse\">25.0</OPTION><OPTION VALUE=\"Mouse\">26.0</OPTION><OPTION VALUE=\"Mouse\">27.0</OPTION><OPTION VALUE=\"Mouse\">28.0</OPTION><OPTION VALUE=\"Mouse\">29.0</OPTION><OPTION VALUE=\"Mouse\">30.0</OPTION><OPTION VALUE=\"Mouse\">31.0</OPTION><OPTION VALUE=\"Mouse\">34.0</OPTION><OPTION VALUE=\"Mouse\">40.0</OPTION><OPTION VALUE=\"Mouse\">50.0</OPTION></SELECT>";
  td2.innerHTML = strHtml2.replace(/!count!/g,count);
 
  var td3 = document.createElement("TD");
  var strHtml3 = "<INPUT TYPE=\"text\" NAME=\"in_name\" SIZE=\"30\" MAXLENGTH=\"30\"  STYLE=\"height:24;border: 1 solid;margin:0;\">";
  td3.innerHTML = strHtml3.replace(/!count!/g,count);
  // create table cell 4
  var td4 = document.createElement("TD");
  var strHtml4 = "<INPUT TYPE=\"text\" NAME=\"in_name\" SIZE=\"30\" MAXLENGTH=\"30\"  STYLE=\"height:24;border: 1 solid;margin:0;\" >";
  td4.innerHTML = strHtml4.replace(/!count!/g,count);
  
  var td5 = document.createElement("TD");
  var strHtml5 = "<INPUT TYPE=\"text\" NAME=\"in_name\" SIZE=\"30\" MAXLENGTH=\"30\"  STYLE=\"height:24;border: 1 solid;margin:0;\" >";
  td5.innerHTML = strHtml5.replace(/!count!/g,count);
  // create table cell 5
  var td6 = document.createElement("TD");
  var strHtml6 = "<INPUT TYPE=\"Button\" CLASS=\"Button\" onClick=\"delRow()\" VALUE=\"Delete Row\">";
  td6.innerHTML = strHtml6.replace(/!count!/g,count);
  // append data to row
  row.appendChild(td1);
  row.appendChild(td2);
  row.appendChild(td3);
  row.appendChild(td4);
  row.appendChild(td5);
  row.appendChild(td6);
  // add to count variable
  count = parseInt(count) + 1;
  // append row to table
  tbody.appendChild(row);
}
function addRow1(in_tbl_name)
{
  var tbody = document.getElementById(in_tbl_name).getElementsByTagName("TBODY")[0];
  // create row
  var row = document.createElement("TR");
  // create table cell 1
  var td1 = document.createElement("TD")
  var strHtml1 = "<FONT SIZE=\"+3\">*</FONT>";
  td1.innerHTML = strHtml1.replace(/!count!/g,count);
  // create table cell 2
  var td2 = document.createElement("TD")
  var strHtml2 = "<INPUT TYPE=\"text\" NAME=\"in_name\" SIZE=\"5\" MAXLENGTH=\"5\"  STYLE=\"height:24;border: 1 solid;margin:0;\">";
  td2.innerHTML = strHtml2.replace(/!count!/g,count);
  // create table cell 3
  var td3 = document.createElement("TD")
  var strHtml3 = "<INPUT TYPE=\"text\" NAME=\"in_name\" SIZE=\"30\" MAXLENGTH=\"30\"  STYLE=\"height:24;border: 1 solid;margin:0;\">";
  td3.innerHTML = strHtml3.replace(/!count!/g,count);
  // create table cell 4
  var td4 = document.createElement("TD")
  var strHtml4 = "<INPUT TYPE=\"text\" NAME=\"in_name\" SIZE=\"20\" MAXLENGTH=\"20\"  STYLE=\"height:24;border: 1 solid;margin:0;\" >";
  td4.innerHTML = strHtml4.replace(/!count!/g,count);
  
  var td5 = document.createElement("TD")
  var strHtml5 = "<INPUT TYPE=\"text\" NAME=\"in_name\" SIZE=\"30\" MAXLENGTH=\"30\"  STYLE=\"height:24;border: 1 solid;margin:0;\">";
  td5.innerHTML = strHtml5.replace(/!count!/g,count);
  
  var td6 = document.createElement("TD")
  var strHtml6 = "<INPUT TYPE=\"text\" NAME=\"in_name\" SIZE=\"30\" MAXLENGTH=\"30\"  STYLE=\"height:24;border: 1 solid;margin:0;\">";
  td6.innerHTML = strHtml6.replace(/!count!/g,count);
  // create table cell 5
  var td7 = document.createElement("TD")
  var strHtml7 = "<INPUT TYPE=\"Button\" CLASS=\"Button\" onClick=\"delRow()\" VALUE=\"Delete Row\">";
  td7.innerHTML = strHtml7.replace(/!count!/g,count);
  // append data to row
  row.appendChild(td1);
  row.appendChild(td2);
  row.appendChild(td3);
  row.appendChild(td4);
  row.appendChild(td5);
  row.appendChild(td6);
  row.appendChild(td7);
  // add to count variable
  count = parseInt(count) + 1;
  // append row to table
  tbody.appendChild(row);
}

function addRow2(in_tbl_name)
{
  var tbody = document.getElementById(in_tbl_name).getElementsByTagName("TBODY")[0];
  // create row
  var row = document.createElement("TR");
  // create table cell 1
  var td1 = document.createElement("TD")
  var strHtml1 = "<FONT SIZE=\"+3\">*</FONT>";
  td1.innerHTML = strHtml1.replace(/!count!/g,count);
  // create table cell 2
  var td2 = document.createElement("TD")
  var strHtml2 = "<INPUT TYPE=\"text\" NAME=\"in_name\" SIZE=\"10\" MAXLENGTH=\"10\"  STYLE=\"height:24;border: 1 solid;margin:0;\" >";
  td2.innerHTML = strHtml2.replace(/!count!/g,count);
  // create table cell 3
  var td3 = document.createElement("TD")
  var strHtml3 = "<INPUT TYPE=\"text\" NAME=\"in_name\" SIZE=\"30\" MAXLENGTH=\"30\"  STYLE=\"height:24;border: 1 solid;margin:0;\">";
  td3.innerHTML = strHtml3.replace(/!count!/g,count);
  // create table cell 4
  var td4 = document.createElement("TD")
  var strHtml4 = "<INPUT TYPE=\"text\" NAME=\"in_name\" SIZE=\"20\" MAXLENGTH=\"20\"  STYLE=\"height:24;border: 1 solid;margin:0;\">";
  td4.innerHTML = strHtml4.replace(/!count!/g,count);
  
  
  // create table cell 5
  var td5 = document.createElement("TD")
  var strHtml5 = "<INPUT TYPE=\"Button\" CLASS=\"Button\" onClick=\"delRow()\" VALUE=\"Delete Row\">";
  td5.innerHTML = strHtml5.replace(/!count!/g,count);
  // append data to row
  row.appendChild(td1);
  row.appendChild(td2);
  row.appendChild(td3);
  row.appendChild(td4);
 
  row.appendChild(td5);
  // add to count variable
  count = parseInt(count) + 1;
  // append row to table
  tbody.appendChild(row);
}


function check()
{
	
	
     return true;
	}



function checkthis(){
   // var num = new Number(str);
  
}


function check2(){
	   // var num = new Number(str);
	  
	    }
	    
	   </script>
	   <script type="text/javascript" src="JS/jquery-1.4.2.min.js"></script>
	   <script type="text/javascript" >
	    
	   $(document).ready(function() {
		     $('#pbutton').click(function(e) {
   			 e.preventDefault();
		    var ajaxdata = $("#treturn").val();
		    var ajaxdata1 = $("#first").val();
		   
		    var ajaxdata2 = $("#returnp").val();
		    
		    var ajaxdata3 = $("#last").val();
		    
		    var ajaxdata4 = $("#pfrom").val();
		    
		    var ajaxdata5 = $("#pto").val();
		   
		    var value ='tr='+ajaxdata+'&f='+ajaxdata1+'&rp='+ajaxdata2+'&l='+ajaxdata3+'&pf='+ajaxdata4+'&pt='+ajaxdata5;
		    
		   
		    	
		    	var re=/^\d{4}\/\d{1,2}\/\d{1,2}$/; 
		        //c5=document.f1.dob.value.match(re);
		        if(document.f2.pfrom.value == '')
		        {
		        	alert("Enter a Date");
		        	
		           document.f2.pfrom.focus();
		            return false;
		      	 }
		        if (! document.f2.pfrom.value.match(re))
		        {
		            alert("Enter a valid date.");
		            document.f2.pfrom.value = "";
		            document.f2.pfrom.focus();
		            return false;
		        }
		        
		        if(document.f2.pto.value == '')
		        {
		        	alert("Enter a Date");
		        	
		           document.f2.pto.focus();
		            return false;
		      	 }
		        if (! document.f2.pto.value.match(re))
		        {
		            alert("Enter a valid date.");
		            document.f2.pto.value = "";
		            document.f2.pto.focus();
		            return false;
		        }  	
		    	
		    	
		  
		    $.ajax({
		    	 type:"post",  //post method
		    	 url: "PeriodicityServlet", //ajaxformexample url
		    	 data: value, //
		    cache: false,
		    success: function(data) {
		   // $("#country").val('');
		 //  $("#message").html(data).slideDown('slow');
		    
		    $('.success').fadeIn(200).show();
		   $('.error').fadeOut(200).hide();
		    }
		    															
		    });
		    	
		    return false;
		});
		    });  
    </script>
    
	  <script type="text/javascript"> 
	  $(document).ready(function() {
		     $('#sbutton').click(function(e) {
			        e.preventDefault();
			    		 var a1 = $("#turnsales").val();
			    		    var a2 = $("#goodstax").val();
			    		    var a3 = $("#nettax").val();
			    		    var a4 = $("#branchtrans").val();
			    		    var a5 = $("#interstate").val();
			    		    var a6 = $("#exportturnover").val();
			    		    var a7 = $("#salesturnover").val();
			    		    var a8 = $("#taxfree").val();
			    		    var a9 = $("#taxable").val();
			    		    var a10 = $("#labour").val();
			    		    var a11 = $("#other").val();
			    		    var a12 = $("#balance").val();
			    		    
	 var value ='ts='+a1+'&gs='+a2+'&nt'+a3+'&bt='+a4+'&is='+a5+'&et='+a6+'&st='+a7+'&tf='+a8+'&tb='+a9+'&l='+a10+'&o='+a11+'&bal='+a12;
	 
	 
	 var re1=/^[0-9]{0,3}(\.[0-9]{0,2})?$/;
	   
	   var c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13;
	  
	    if(document.f3.turnsales.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f3.turnsales.focus();
	        return false;
	  	 }
	    if (! document.f3.turnsales.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f3.turnsales.value = "0";
	        document.f3.turnsales.focus();
	        return false;
	    }
	    
	    if(document.f3.goodstax.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f3.goodstax.focus();
	        return false;
	  	 }
	    if (! document.f3.goodstax.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f3.goodstax.value = "0";
	        document.f3.goodstax.focus();
	        return false;
	    }
	    
	    if(document.f3.nettax.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f3.nettax.focus();
	        return false;
	  	 }
	    if (! document.f3.nettax.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f3.nettax.value = "0";
	        document.f3.nettax.focus();
	        return false;
	    }
	    if(document.f3.branchtrans.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f3.branchtrans.focus();
	        return false;
	  	 }
	    if (! document.f3.branchtrans.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f3.branchtrans.value = "0";
	        document.f3.branchtrans.focus();
	        return false;
	    }
	    if(document.f3.interstate.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f3.interstate.focus();
	        return false;
	  	 }
	    if (! document.f3.interstate.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f3.interstate.value = "0";
	        document.f3.interstate.focus();
	        return false;
	    }
	    if(document.f3.exportturnover.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f3.exportturnover.focus();
	        return false;
	  	 }
	    if (! document.f3.exportturnover.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f3.exportturnover.value = "0";
	        document.f3.exportturnover.focus();
	        return false;
	    }
	    if(document.f3.salesturnover.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f3.salesturnover.focus();
	        return false;
	  	 }
	    if (! document.f3.salesturnover.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f3.salesturnover.value = "0";
	        document.f3.salesturnover.focus();
	        return false;
	    }
	    
	    if(document.f3.taxfree.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f3.taxfree.focus();
	        return false;
	  	 }
	    if (! document.f3.taxfree.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f3.taxfree.value = "0";
	        document.f3.taxfree.focus();
	        return false;
	    }
	    if(document.f3.taxable.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f3.taxable.focus();
	        return false;
	  	 }
	    if (! document.f3.taxable.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f3.taxable.value = "0";
	        document.f3.taxable.focus();
	        return false;
	    }
	    if(document.f3.labour.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f3.labour.focus();
	        return false;
	  	 }
	    if (! document.f3.labour.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f3.labour.value = "0";
	        document.f3.labour.focus();
	        return false;
	    }
	    if(document.f3.other.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f3.other.focus();
	        return false;
	  	 }
	    if (! document.f3.other.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f3.other.value = "0";
	        document.f3.other.focus();
	        return false;
	    }
	    if(document.f3.balance.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f3.balance.focus();
	        return false;
	  	 }
	    if (! document.f3.balance.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f3.balance.value = "0";
	        document.f3.balance.focus();
	        return false;
	    }
	    
	    $.ajax({
	    	 type:"post",  //post method
	    	 url: "SalesServlet", //ajaxformexample url
	    	 data: value, //
	    cache: false,
	    success: function(data) {
	   // $("#country").val('');
	 //  $("#message").html(data).slideDown('slow');
	    
	    	 $('.success').fadeIn(200).show();
			   $('.error').fadeOut(200).hide();  		    }
	    															
	    });
	    	
	    return false;
	});
	    }); 
    </script>
    
    <script type="text/javascript"> 
    $(document).ready(function() {
	     $('#purbutton').click(function(e) {
			        e.preventDefault();
			    		 var a1 = $("#purchasereturn").val();
			    		    var a2 = $("#goodsreturn").val();
			    		    var a3 = $("#direct").val();
			    		    var a4 = $("#highseas").val();
			    		    var a5 = $("#interstate").val();
			    		    var a6 = $("#taxable").val();
			    		    var a7 = $("#statebranch").val();
			    		    var a8 = $("#consign").val();
			    		    var a9 = $("#statepurchase").val();
			    		    var a10 = $("#withinstate").val();
			    		    var a11 = $("#fully").val();
			    		    var a12 = $("#taxfree").val();
			    		    var a13 = $("#other").val();
			    		    var a14 = $("#bal").val();
			    		    
	 var value ='pr='+a1+'&gr='+a2+'&d'+a3+'&hs='+a4+'&is='+a5+'&tb='+a6+'&sb='+a7+'&cs='+a8+'&sp='+a9+'&ws='+a10+'&f='+a11+'&tf='+a12+'&o='+a13+'&bal='+a14;
	 
	 var re1=/^[0-9]{0,3}(\.[0-9]{0,2})?$/;
	   
	  
	    if(document.f4.purchaseturn.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f4.purchaseturn.focus();
	        return false;
	  	 }
	    if (! document.f4.purchaseturn.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f4.purchaseturn.value = "0";
	        document.f4.purchaseturn.focus();
	        return false;
	    }
	    
	    if(document.f4.goodsreturn.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f4.goodsreturn.focus();
	        return false;
	  	 }
	    if (! document.f4.goodsreturn.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f4.goodsreturn.value = "0";
	        document.f4.goodsreturn.focus();
	        return false;
	    }
	    
	    if(document.f4.direct.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f4.direct.focus();
	        return false;
	  	 }
	    if (! document.f4.direct.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f4.direct.value = "0";
	        document.f4.direct.focus();
	        return false;
	    }
	    
	    if(document.f4.highseas.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f4.highseas.focus();
	        return false;
	  	 }
	    if (! document.f4.highseas.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f4.highseas.value = "0";
	        document.f4.highseas.focus();
	        return false;
	    }
	    
	    if(document.f4.interstate.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f4.interstate.focus();
	        return false;
	  	 }
	    if (! document.f4.interstate.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f4.interstate.value = "0";
	        document.f4.interstate.focus();
	        return false;
	    }
	    if(document.f4.taxable.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f4.taxable.focus();
	        return false;
	  	 }
	    if (! document.f4.taxable.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f4.taxable.value = "0";
	        document.f4.taxable.focus();
	        return false;
	    }
	    
	    if(document.f4.statebranch.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f4.statebranch.focus();
	        return false;
	  	 }
	    if (! document.f4.statebranch.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f4.statebranch.value = "0";
	        document.f4.statebranch.focus();
	        return false;
	    }
	    if(document.f4.consign.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f4.consign.focus();
	        return false;
	  	 }
	    if (! document.f4.consign.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f4.consign.value = "0";
	        document.f4.consign.focus();
	        return false;
	    }
	    if(document.f4.statepurchase.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f4.statepurchase.focus();
	        return false;
	  	 }
	    if (! document.f4.statepurchase.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f4.statepurchase.value = "0";
	        document.f4.statepurchase.focus();
	        return false;
	    }
	    if(document.f4.withinstate.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f4.withinstate.focus();
	        return false;
	  	 }
	    if (! document.f4.withinstate.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f4.withinstate.value = "0";
	        document.f4.withinstate.focus();
	        return false;
	    }
	    if(document.f4.fully.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f4.fully.focus();
	        return false;
	  	 }
	    if (! document.f4.fully.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f4.fully.value = "0";
	        document.f4.fully.focus();
	        return false;
	    }
	    
	    if(document.f4.taxfree.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f4.taxfree.focus();
	        return false;
	  	 }
	    if (! document.f4.taxfree.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f4.taxfree.value = "0";
	        document.f4.taxfree.focus();
	        return false;
	    }
	    
	    if(document.f4.other.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f4.other.focus();
	        return false;
	  	 }
	    if (! document.f4.other.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f4.other.value = "0";
	        document.f4.other.focus();
	        return false;
	    }
	    
	    if(document.f4.bal.value == '')
	    {
	    	alert("Enter a value");
	    	
	    	document.f4.bal.focus();
	        return false;
	  	 }
	    if (! document.f4.bal.value.match(re1))
	    {
	        alert("Enter a valid value.");
	        document.f4.bal.value = "0";
	        document.f4.bal.focus();
	        return false;
	    }
	  $.ajax({
	    	 type:"post",  //post method
	    	 url: "PurchaseServlet", //ajaxformexample url
	    	 data: value, //
	    cache: false,
	    success: function(data) {
	   // $("#country").val('');
	   $("#message").html(data).slideDown('slow');
	    
	    	// $('.success').fadeIn(200).show();
			//   $('.error').fadeOut(200).hide();  		    }
	    															
	    });
	    	
	    return false;
	});
	    }); 
	 </script>
    
    <script type="text/javascript">    
    $(document).ready(function() {
	     $('#mbutton').click(function(e) {
		        e.preventDefault();
		    		 var ajaxdata = $("#mvat").val();
		    		    var ajaxdata1 = $("#cst").val();
		    		   
		    		    var ajaxdata2 = $("#eligible").val();
		    		    
		    		    var ajaxdata3 = $("#location").val();
		    		    
		    		    var ajaxdata4 = $("#email").val();
		    		    
		    		    var ajaxdata5 = $("#phone").val();
		    		    var ajaxdata6 = $("#block").val();
		    		    var ajaxdata7 = $("#building").val();
		    		    var ajaxdata8 = $("#street").val();
		    		    var ajaxdata9 = $("#area").val();
		    		    var ajaxdata10 = $("#city").val();
		    		    var ajaxdata11 = $("#dist").val();
		    		    var ajaxdata12 = $("#pin").val();
		    		   
		    		    var value ='mvat='+ajaxdata+'&cst='+ajaxdata1+'&eligible='+ajaxdata2+'&location='+ajaxdata3+'&email='+ajaxdata4+'&phone='+ajaxdata5+'&block='+ajaxdata6+'&building='+ajaxdata7+'&street='+ajaxdata8+'&area='+ajaxdata9+'&city='+ajaxdata10+'&dist='+ajaxdata11+'&pin='+ajaxdata12;
		    		    
		    		    
		    		    var c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11;
		    			var namevalid=/^[a-zA-Z ]+$/;
		    			 c1= document.f1.mvat.value;
		    		     if(c1.length==0)
		    		     {
		    		     	alert("Enter MVAT RC no.");
		    		     	
		    		        document.f1.mvat.focus();
		    		         return false;
		    		   	 }
		    		     
		    		     if(!c1.match(/^\d+$/))
		    		   	 {
		    		    	 alert("Please Enter MVAT RC no. in Numerics only");
		    		    	 document.f1.mvat.value="";
		    		         document.f1.mvat.focus();
		    		         return false;
		    		   	 }
		    		     
		    		     c2= document.f1.email.value;
		    		     
		    		     var regex = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		    		     
		    		    
		    		     if(c2.length == 0)
		    		     {
		    		         alert("Please Enter Email address");
		    		         
		    		         document.f1.email.focus();
		    		         return false;
		    		     }
		    		     if(regex.test(c2) == false)
		    		     {
		    		          alert("Invalid Email Address");
		    		          document.f1.email.value="";
		    		          document.f1.email.focus();
		    		          return false;
		    		      }
		    		     
		    		     
		    		     c3= document.f1.phone.value;
		    		     if(c3.length == 0)
		    		     {
		    		         alert("Please Enter Phone Number");
		    		         
		    		         document.f1.phone.focus();
		    		         return false;
		    		     }
		    		     
		    		     if(c3.indexOf(" ")!=-1)
		    			 {
		    		   		alert("Invalid Phone No.");
		    		   		document.f1.phone.value="";
		    		           document.f1.phone.focus();
		    		  		return false;
		    			 }
		    		     if(c3.length<10)
		    		  	 {
		    		      	alert("Phone Number should not be less than 10 digit");
		    		      	document.f1.phone.value="";
		    		        document.f1.phone.focus();
		    		    		return false;
		    		  	 }
		    			  if(c3.length>10)
		    		 	 {
		    		     	alert("Phone Number should be 10 digit");
		    		     	document.f1.phone.value="";
		    		       document.f1.phone.focus();
		    		   		return false;
		    		 	 }
		    			  
		    			  c4= document.f1.block.value;
		    			     if(c4.length==0)
		    			     {
		    			     	alert("Enter Block/Flat no.");
		    			     	
		    			        document.f1.block.focus();
		    			         return false;
		    			   	 }
		    			     
		    			     if(!c4.match(/^\d+$/))
		    			   	 {
		    			    	 alert("Please Enter Block/Flat no. in Numerics only");
		    			    	 document.f1.block.value="";
		    			         document.f1.block.focus();
		    			         return false;
		    			   	 }
		    			     
		    			     c5= document.f1.building.value;

		    		         if(c5.length==0)
		    		         {
		    		         	alert("Enter Building/Village Name");
		    		         	
		    		            document.f1.building.focus();
		    		             return false;
		    		       	}
		    		          if(c5.search(namevalid)==-1)
		    		         {
		    		             alert("Please Enter valid Building/Village name");
		    		             document.f1.building.value="";
		    		             document.f1.building.focus();
		    		             
		    		 	         return false;
		    		     	 }

		    		         c6= document.f1.street.value;

		    		         if(c6.length==0)
		    		         {
		    		         	alert("Enter Street/Road Name");
		    		         	
		    		            document.f1.street.focus();
		    		             return false;
		    		       	}
		    		         if(c6.search(namevalid)==-1)
		    		         {
		    		             alert("Please Enter valid  Street/Road name");
		    		             document.f1.street.value="";
		    		             document.f1.street.focus();
		    		             
		    		 	         return false;
		    		     	 }
		    		         
		    		         c7= document.f1.area.value;

		    		         if(c7.length==0)
		    		         {
		    		         	alert("Enter Area/Locality Name");
		    		         	
		    		            document.f1.area.focus();
		    		             return false;
		    		       	}
		    		         if(c7.search(namevalid)==-1)
		    		         {
		    		             alert("Please Enter valid  Area/Locality name");
		    		             document.f1.area.value="";
		    		             document.f1.area.focus();
		    		             
		    		 	         return false;
		    		     	 }
		    			      c8= document.f1.city.value;
		    		          if(c8.length == 0)
		    		          {
		    		              alert("Please Enter City");
		    		              
		    		              document.f1.city.focus();
		    		              return false;
		    		          }
		    		          if(c8.search(namevalid)==-1)
		    		          {
		    		              alert("Please Enter valid  City name");
		    		              document.f1.city.value="";
		    		              document.f1.city.focus();
		    		              
		    		  	         return false;
		    		      	 }
		    		          c9= document.f1.dist.value;
		    		          if(c9.length == 0)
		    		          {
		    		              alert("Please Enter District");
		    		             
		    		              document.f1.dist.focus();
		    		              return false;
		    		          }
		    		           if(c9.search(namevalid)==-1)
		    		          {
		    		              alert("Please Enter valid District name");
		    		              document.f1.dist.value="";
		    		              document.f1.dist.focus();
		    		              
		    		  	         return false;
		    		      	 }
		    		           
		    		           c10= document.f1.pin.value;
		    		           if(c10.length==0)
		    		           {
		    		           	alert("Enter Pincode");
		    		           	
		    		             document.f1.pin.focus();
		    		               return false;
		    		         	 }
		    		           
		    		            if(!c10.match(/^\d+$/))
		    		         	 {
		    		          	 alert("Please Enter Pincode in Numerics only");
		    		          	document.f1.pin.value="";
		    		             document.f1.pin.focus();
		    		               return false;
		    		         	 }
		    		            if(c10.indexOf(" ")!=-1)
		    		      	 {
		    		         		alert("Invalid Pincode No.");
		    		         		document.f1.pin.value="";
		    		                 document.f1.pin.focus();
		    		        		return false;
		    		      	 }
		    		      	  if(c10.length>6)
		    		       	 {
		    		           	alert("Pincode should be 6 digit");
		    		           	document.f1.pin.value="";
		    		             document.f1.pin.focus();
		    		         		return false;
		    		       	 }
		    		  
		    		    $.ajax({
		    		    	 type:"post",  //post method
		    		    	 url: "MasterServlet", //ajaxformexample url
		    		    	 data: value, //
		    		    cache: false,
		    		    success: function(data) {
		    		   // $("#country").val('');
		    		 //  $("#message").html(data).slideDown('slow');
		    		    
		    		    	 $('.success').fadeIn(200).show();
		    				   $('.error').fadeOut(200).hide();  		    }
		    		    															
		    		    });
		    		    	
		    		    return false;
		    		});
		    		    }); 
    function sub()
    {
   var c3,c1,c2,c4,c5,c6,c7,c8,c9,c10,c11,c12;
   c1=document.getElementById("turnsales").value;
   c2=document.getElementById("goodstax").value;
   c3=document.getElementById("nettax").value;
   c4=document.getElementById("branchtrans").value;
   c5=document.getElementById("interstate").value;
   c6=document.getElementById("exportturnover").value;
   c7=document.getElementById("salesturnover").value;
   c8=document.getElementById("taxfree").value;
   c9=document.getElementById("taxable").value;
   c10=document.getElementById("labour").value;
   c11=document.getElementById("other").value;
   c12=parseFloat(c1)-parseFloat(c2)-parseFloat(c3)-parseFloat(c4)-parseFloat(c5)-parseFloat(c6)-parseFloat(c7)-parseFloat(c8)-parseFloat(c9)-parseFloat(c10)-parseFloat(c11); 
   document.getElementById("balance").value=c12;
     
   
    }
   
    
    
</script>


<!--

<script type="text/javascript">
//$(document).ready(function() {
  //  $('#pbutton').click(function(e) {
    	$(function() {

    		$(".submit").click(function() {
	
      e.preventDefault();
    var ajaxdata = $("#treturn").val();
    var ajaxdata1 = $("#first").val();
   
    var ajaxdata2 = $("#returnp").val();
    
    var ajaxdata3 = $("#last").val();
    
    var ajaxdata4 = $("#pfrom").val();
    
    var ajaxdata5 = $("#pto").val();
   
    var value ='tr='+ajaxdata+'&f='+ajaxdata1+'&rp='+ajaxdata2+'&l='+ajaxdata3+'&pf='+ajaxdata4+'&pt='+ajaxdata5;
    
    if(ajaxdata=='' || ajaxdata1=='' || ajaxdata2=='' || ajaxdata3=='' || ajaxdata4=='' || ajaxdata5=='')
    {
    $('.success').fadeOut(200).hide();
    $('.error').fadeOut(200).show();
    }
    else
    {
    	
    	
    	//$(document).ready(function() {*/
    	
    $.ajax({
    	 type:"post",  //post method
    	 url: "period.jsp", //ajaxformexample url
    	 data: value, //
    cache: false,
    success: function(data) {
   // $("#country").val('');
  // $("#message").html().slideDown('slow');
    
    $('.success').fadeIn(200).show();
   $('.error').fadeOut(200).hide();
    }
    															
    });
    	}
    return false;
});
    });  
//    	});
    /*	var xhReq = new XMLHttpRequest();
    	xhReq.open("post", "PeriodicityServlet", false);
    	xhReq.send(null);
    	var serverResponse = xhReq.responseText;
    	alert(serverResponse); 
    	*/
</script>  -->
</head>
<body  onload="init()">
<h2 align="center">Form 231</h2>

<ul id="tabs">
  <li><a href="#master">Master Information</a></li>
  <li><a href="#period">Periodicity</a></li>
  <li><a href="#sales">Sales Data</a></li>
  <li><a href="#compusales">Computation of Sales</a></li>
  <li><a href="#purchase">Purchase Data</a></li>
  <li><a href="#compupurchase">Computation of Purchase</a></li>
   <li><a href="#setoff">Computation of set-off</a></li>
    <li><a href="#tax">Computation of Tax</a></li>
    <li><a href="#amount">Details of Amount</a></li>
    <li><a href="#rao">Details of RAO</a></li>
    <li><a href="#declare">Declaration</a></li>
    
</ul>
<div class="tabContent" id="master">
  
  <div>
  <form name="f1" action="MasterServlet" autocomplete="off" enctype="multipart/form-data"  method=post >
    <table cellspacing=6>
    <tr>
    <td>1.</td>
    </tr>
    <tr>
    <td>M.V.A.T. RC No.</td>
    <td><input type="text" name="mvat" id="mvat"/></td>
    </tr>
     <tr>
    <td>If hoilding CST RC Please select</td>
    <td><select  name="cst" id="cst">
    <option>Yes</option>
    <option>No</option>
    </select></td>
    </tr>
     <tr>
    <td>Eligible for 704</td>
    <td><select name="eligible" id="eligible">
    <option>Yes</option>
    <option>No</option>
    </select></td>
    </tr>
     <tr>
    <td>Location of Sales Tax officer having jurisdiction over</td>
    <td><select  name="location" id="location">
    <option>1-Mazgaon</option>
    <option>05-Thane</option>
    <option>06-Kalyan</option>
    <option>07-Palghar</option>
    <option>08-Nalasopar</option>
    <option>09-Pune</option>
    <option>10-Solapur</option>
    <option>11-Barshi</option>
    <option>12-Nashik</option>
    <option>13-Malegaon</option>
    <option>14-Dhule</option>
    <option>15-Jalgaon</option>
    <option>16-Ahmednagar</option>
    <option>17-Kolhapur</option>
    <option>18-Satara</option>
    <option>19-Sangli</option>
    <option>20-Ratnagiri</option>
    <option>21-Oras</option>
    <option>22-Nagpur</option>
    <option>23-Akola</option>
    <option>24-Amravati</option>
    <option>25-Varda</option>
    <option>26-Yeotmal</option>
    <option>27-Chandrapur</option>
    <option>28-Gondia</option>
    <option>29-Khamgaon</option>
    <option>30-Gadchiroli</option>
    <option>31-Aurangabad</option>
    <option>32-Beed</option>
    <option>33-Parbhani</option>
    <option>34-Latur</option>
    <option>35-Nanded</option>
    <option>36-Osmanabad</option>
    <option>37-Jalna</option>
    <option>38-Bhandara</option>
    <option>39-Hingoli</option>
    <option>40-Nandurbar</option>
    <option>41-Raigad</option>
    <option>42-Washim</option>
    <option>43-Alibaugh</option>
    </select></td>
    </tr>
     <tr>
    <td>Email id of Dealer</td>
    <td><input type="text" name="email" id="email"/></td>
    </tr>
     <tr>
    <td>Phone no. of Dealer </td>
    <td><input type="text" name="phone" id="phone"/></td>
    </tr>
     <tr>
    <td>Block no/Flat</td>
    <td><input type="text" name="block" id="block"/></td>
    </tr>
     <tr>
    <td>Name of Premises/Building/Village</td>
    <td><input type="text" name="building" id="building"/></td>
    </tr>
     <tr>
    <td>Street/Road</td>
    <td><input type="text" name="street" id="street"/></td>
    </tr>
     <tr>
    <td>Area/Locality</td>
    <td><input type="text" name="area" id="area"/></td>
    </tr>
     <tr>
    <td>City</td>
    <td><input type="text" name="city" id="city"/></td>
    </tr>
     <tr>
    <td>District</td>
    <td><input type="text" name="dist" id="dist"/></td>
    </tr>
     <tr>
    <td>Pincode</td>
    <td><input type="text" name="pin" id="pin"/></td>
    </tr>
    <tr><td align="center"><input type="Button" id="mbutton" name="mbutton" value="Save" class="submit"/></td>
   <td><span class="error" style="display:none"> Please Enter Valid Data</span>
<span class="success" style="display:none"> Data saved Successfully</span></td>
    </tr>
    </table>
    
   </form>
   
  </div>
</div>


<div class="tabContent" id="period">
  
  <div>
  <form name="f2" id="periodform" action="PeriodicityServlet" autocomplete="off" enctype="multipart/form-data" method=post>
    <table cellspacing=8>
    <tr>
    <td>2.</td>
    </tr>
    <tr>
    <td>Type of return(select appropriate)</td>
    <td><select id="treturn" name="typereturn" id="typereturn">
    <option>Original</option>
    <option>Fresh</option>
    <option>Revised_under_s_20(4)(a)</option>
    <option>Revised_under_s_20(4)(b)</option>
    <option>Revised_under_s_20(4)(c)</option>
    </select></td>
    </tr>
    <tr>
    <td>Whether first return?(In case of new registration/new package scheme dealer)</td>
    <td><select  name="first" id="first">
    <option>Yes</option>
    <option>No</option></select></td>
    </tr>
    <tr>
    <td>Periodicity of return(select appropriate)</td>
    <td><select  name="returnp" id="returnp">
    <option>Monthly</option>
    <option>Quarterly</option>
    <option>Six-monthly</option>
    <option>Annual</option></select></td>
    </tr>
    <tr>
    <td>Whether last return (In case of Cancellation of Registration or For new<br> package scheme dealer for end of non package scheme period or<br> end of package scheme period)</td>
    <td><select  name="last" id="last">
    <option>Yes</option>
    <option>No</option></select></td>
    </tr>
    <tr>
    <td>Period covered by return:</td>
    <td align=center>From:</td>
    <td><input type="text" name="pfrom" id="pfrom" /></td>
    <td>To:</td>
    <td><input type="text" name="pto" id="pto" /></td>
    <td>(yyyy/mm/dd)</td>
    </tr>
    <tr>
    <td align="center"><input type="Button" id="pbutton" name="pbutton" value="Save"  /></td>
     <td><span class="error" style="display:none"> Please Enter Valid Data</span>
<span class="success" style="display:none"> Data saved Successfully</span></td>
    </tr>
    </table>
    </form>
    <br><font face="verdana" size="2"><div id="message"></div></font>
  </div>
</div>

<div class="tabContent" id="sales">
  
  <div>
  <form name="f3" action="SalesServlet" autocomplete="off" enctype="multipart/form-data" method=post>
    <table cellspacing=8>
    <tr>
    <td>3.</td>
    </tr>
     <%
     
     double a=0.0,a1=0.0,a2=0.0;
   try{
   //	System.out.print("hiii");	
    Class.forName("com.mysql.jdbc.Driver");
      Connection con = DriverManager.getConnection("jdbc:mysql://localhost/boa", "root", "root");
     Statement st=con.createStatement();
			String sql=("select sum(stota),sum(stamount) from salesvoucher; ");
          ResultSet  rs=st.executeQuery(sql);
            
				 while(rs.next())
				 {
					  a=rs.getDouble(1);
					 a1=rs.getDouble(2);
					 a2=a+a1;
				 }
				 con.close();
   }
				 catch(Exception e1)
	   			  {
	   				  e1.printStackTrace();
	   			  }
   %>
   <tr>
   <td>a) Gross turnover of sales including, taxes, as well as <br>turnover of non sales transactions like value of branch/<br> consignment transfers, job work charges etc</td>
   <td><input type="text" name="turnsales" id="turnsales" value="<%=a2 %>" onblur="sub();"/></td>
   </tr>
  
    <tr>
    <td>b) Less:- Value, inclusive of sales tax of Goods Returned<br> including reduction of sales price on account of rate<br> difference and discount</td>
    <td><input type="text" name="goodstax" id="goodstax" value="0" onblur="sub();"/></td>
    </tr>
    <tr>
    <td>c) Less:-Net Tax amount (Tax included in sales shown in (a)<br> above less Tax included in (b) above)</td>
    <td><input type="text" name="nettax" id="nettax" value="<%=a%>" onblur="sub();"/></td>
    </tr>
    <tr>
    <td>d) Less:-Value of Branch Transfers / consignment transfers<br> within the State If Tax is Paid by an Agent</td>
    <td><input type="text" name="branchtrans" id="branchtrans" value="0" onblur="sub();"/></td>
    </tr>
    <tr>
    <td>e) Less:- Sales u/s 8(1) i.e. Inter state sales including Central<br> Sales Tax in the course of Imports , Exports and value of Branch<br> Transfers outside the State</td>
					<td><input type="text" name="interstate" id="interstate" value="0" onblur="sub();"/></td>
    </tr>
    <tr>
    <td>Less:-Turnover of export sales u/s 5(1) and 5(3) of the CST Act<br> 1956 included in Box(e)</td>
    <td><input type="text" name="exportturnover" id="exportturnover" value="0" onblur="sub();"/></td>
    </tr>
    <tr>
    <td>Less:-Turnover of sales in the course of import u/s 5(2) of the<br> CST Act 1956 included in Box (e)</td>
    <td><input type="text" name="salesturnover" id="salesturnover" value="0" onblur="sub();"/></td>
    </tr>
    <tr>
    <td> f) Less:- Sales tax-free goods specified in Schedule A <br>of MVAT Act</td>
    <td><input type="text" name="taxfree" id="taxfree" value="0" onblur="sub();"/></td>
    </tr>
    <tr>
    <td>g) Less:-Sales of taxable goods fully exempted u/s 41 and<br> u/s 8 other than sales under section 8(1) & <br> covered in Box5(e)</td>
    <td><input type="text" name="taxable" id="taxable" value="0" onblur="sub();"/></td>
    </tr>
    
    <tr>
    <td>h) Less:- Labour Charges/Job work charges</td>
    <td><input type="text" name="labour" id="labour" value="0" onblur="sub();"/></td>
    </tr>
    <tr>
    <td>i) Less:- Other allowable deductions, if any</td>
    <td><input type="text" name="other" id="other" value="0" onblur="sub();"/></td>
    </tr>
    <tr>
    <td>j) Balance:- Net turnover of Sales liable to tax<br> [a-(b+c+d+e+f+g+h+i)]</td>
    <td><input type="text" name="balance" id="balance" value="0" /></td>
    </tr>
    <tr>
    <td align="center"><input type="Button" id="sbutton" name="sbutton" value="Save" /></td>
    </tr>
    </table>
    </form>
    </div>
    </div>
    
    
    <div  class="tabContent" id="compusales">
     <div>
     4.
     <form name="f5">
    <TABLE ID="sale" border="1" align="center" STYLE="border width:1 orange dashed;background color:#F0E68C;table-row width:4;">
    
<TR><TH>Sr. NO.</TH>
<TH WIDTH="70">Rate of Tax</TH>
<TH WIDTH="230">Turn over Sales</TH>
<TH WIDTH="70">Tax Amount</TH>
<TD ALIGN="center"><INPUT TYPE="Button" onClick="addRow('sale')" VALUE="Add Row"></TD></TR>
</TABLE>
   <table align="center">
    <tr><td><input type="submit" value="Total Turnover"/></td>
    <td><input type="text" value="0" /></td>
    <td><input type="submit" value="Total Tax Amount"/></td>
    <td><input type="text" value="0"/></td>
    </tr>
    <tr><td><input type="submit" value="Save"/></td></tr>
    </table>
    </form>
    </div>
    </div>
    
    <div  class="tabContent" id="purchase">
     <div>
     <form name="f4" action="PurchaseServlet" autocomplete="off" enctype="multipart/form-data" method=post>
    <table cellspacing=8>
    <tr>
    <td>5.</td>
    </tr>
     <%
     
     double b=0.0,b1=0.0,b2=0.0;
   try{
   //	System.out.print("hiii");	
    Class.forName("com.mysql.jdbc.Driver");
      Connection con = DriverManager.getConnection("jdbc:mysql://localhost/boa", "root", "root");
     Statement st=con.createStatement();
			String sql=("select sum(pvtota),sum(pvtaxa) from purchasevoucher; ");
          ResultSet  rs=st.executeQuery(sql);
            
				 while(rs.next())
				 {
					  b=rs.getDouble(1);
					 b1=rs.getDouble(2);
					 b2=b+b1;
				 }
				 con.close();
   }
				 catch(Exception e1)
	   			  {
	   				  e1.printStackTrace();
	   			  }
   %>
   <tr>
   <td>a) Total Turnover of Purchase including taxes. value of Branch <br>Transfers/Consignment Transfers/Consignment Transfers<br> received and Labour/ job work charges</td>
					<td><input type="text" name="purchasereturn" id="purchasereturn" value="<%=b2%>"/></td>
   </tr>
   <tr>
   <td>b) Less:-Value of goods return(inclusive of tax,including reduction<br> of Purchase price"
					+ "on account of rate difference and discount</td>
  <td><input type="text" name="goodsreturn" id="goodsreturn" value="0"/></td>
   </tr>
   <tr>
   <td>c) Less:-Imports (Direct imports)</td>
    <td><input type="text" name="direct" id="direct" value="0"/></td>
   </tr>
   
   <tr>
   <td>d) Less:-Imports (High seas purchases)</td>
   <td><input type="text" name="highseas" id="highseas" value="0"/></td>
   </tr>
   
   <tr>
   <td>e) Less:-Inter-State purchase (Excluding purchases<br> against certificate in form 'H')</td>
   <td><input type="text" name="interstate" id="interstate" value="0"/></td>
   </tr>
   <tr>
   <td>e1) Less:-Purchases of taxable goods (either local or Interstate) <br>against certificate in Form 'H'</td>
   <td><input type="text" name="taxable" id="taxable" value="0"/></td>
   </tr>
   
   <tr>
   <td>f) Less:-Inter-State branch /consignment transfers received</td>
   <td><input type="text" name="statebranch" id="statebranch" value="0"/></td>
   </tr>
   
   <tr>
   <td>g) Less:-Within the State Branch Transfers /Consignment Transfers<br> received where tax is to be paid by an agent</td>
   <td><input type="text" name="consign" id="consign" value="0"/></td>
   </tr>
   
   <tr>
   <td>h) Less:-Within the State purchases of taxable goods from <br>un-registered dealers</td>
   <td><input type="text" name="statepurchase" id="statepurchase" value="0"/></td>
   </tr>
   
   <tr>
   <td>i) Less:-Within the State Purchases of taxable goods from<br> registered dealers under MVAT Act, 2002<br> and which are not eligible for set</td>
   <td><input type="text" name="withinstate" id="withinstate" value="0"/></td>
   </tr>
   
   <tr>
   <td>j) Less:-Within the State purchases of taxable goods which<br> are fully exempted from tax u/s 41 and u/s<br> 8 but not covered under section</td>
   <td><input type="text" name="fully" id="fully" value="0"/></td>
   </tr>
   
   <tr>
   <td>k) Less:-Within the State purchases of tax-free goods <br>specified in Schedule A</td>
   <td><input type="text" name="taxfree" id="taxfree" value="0"/></td>
   </tr>
   
   <tr>
   <td>l) Less:-Other allowable deductions, if any</td>
   <td><input type="text" name="other" id="other" value="0"/></td>
   </tr>
   
   <tr>
   <td>m) Balance: Within the State purchases of Taxable goods<br> from registered dealers eligible for set-off<br>[a-(b+c+d+e+e1+f+g+h+i+j+k+l)]</td>
   <td><input type="text" name="bal" id="bal" value="0"/></td>
   </tr>
   <tr><td align="center"><input type="Button" id="purbutton" name="purbutton" value="Save" /></td>
   <td><span class="error" style="display:none"> Please Enter Valid Data</span>
<span class="success" style="display:none"> Data saved Successfully</span></td>
   </tr>
</table>
</form>
    </div>
    </div>
    <div  class="tabContent" id="compupurchase">
    <div>
    6.
   <TABLE ID="tbl2" border="1" align="center" STYLE="border width:1 orange dashed;background color:#F0E68C;table-row width:4;">
<TR><TH>Sr. NO.</TH>
<TH WIDTH="70">Rate of Tax</TH>
<TH WIDTH="230">Turn over Sales</TH>
<TH WIDTH="70">Tax Amount</TH>
<th width="230">Turnover+Tax Amount</th>
<TD ALIGN="center"><INPUT TYPE="Button" onClick="addRow0('tbl2')" VALUE="Add Row"></TD></TR>

</TABLE>
    <table align="center">
    <tr><td><input type="submit" value="Total Turnover"/></td>
    <td><input type="text" value="0" /></td>
    <td><input type="submit" value="Total Tax Amount"/></td>
    <td><input type="text" value="0"/></td>
    <td><input type="submit" value="Total Amount"/></td>
    <td><input type="text" value="0"/></td>
    </tr>
    <tr><td><input type="submit" value="Save"></td></tr>
    </table>
    </div>
    </div>
    
    <div class="tabContent" id="setoff">
    <div>
<table cellspacing=8>
<tr>
<td>7.</td>
</tr>
<tr>
<td>a) Within the State purchases of taxable goods from<br> registered dealers eligible for set-off<br> as per Box 6   </td>
<td><input type="text" value="0"/></td>
<td><input type="text" value="0"/></td>
</tr>

<tr>
<td>b) Less:-Reduction in the amount of set_off u/r 53(1) of the<br> corresponding purchase price of<br>(Sch C,D & E) goods</td>
<td><input type="text" value="0"/></td>
<td><input type="text" value="0"/></td>
</tr>

<tr>
<td>Less:-Reduction in the amount of set_off u/r 53(2) of the <br>corresponding purchase price  of (Sch B) goods</td>
<td><input type="text" value="0"/></td>
<td><input type="text" value="0"/></td>
</tr>

<tr>
<td>c) Less:-Reduction in the amount of set_off under any other<br> sub rule of Rule 53</td>
<td><input type="text" value="0"/></td>
<td><input type="text" value="0"/></td>
</tr>

<tr>
<td>d) Add:-Adjustment on account of set_off claimed Short<br> in earlier return</td>
<td></td>
<td><input type="text" value="0"/></td>
</tr>

<tr>
<td>e) Less:-Adjustment on account of set_off claimed Excess<br> in earlier return</td>
<td></td>
<td><input type="text" value="0"/></td>
</tr>

<tr>
<td>f) Set-off available for the period of this return<br> [a-(b+c+d+e)]</td>
<td></td>
<td><input type="text" value="0"/></td>
</tr>

<tr><td align="center"><input type="submit" value="Save"/></td></tr>
</table>
    </div>
    </div>
    
    
    <div class="tabContent" id="tax" >
    <div>
    <table cellspacing=8>
    <tr>
   <td>8.</td>
    </tr>
    <tr>
    <td><u>A. Aggregate of credit available for the period covered under this return</u></td>
    </tr>
    <tr>
    <td>a) Set-off available as per Box 7(f)</td>
    <td><input type="text" value="0"/></td>
    </tr>
    <tr>
    <td>b) Excess credit brought forward from previous return</td>
    <td><input type="text" value="0"/></td>
    </tr>
    
    <tr>
    <td>c) Amount already paid (Details to be entered in Box 8 E)</td>
    <td><input type="text" value="0"/></td>
    </tr>
    
    <tr>
    <td>d) Excess Credit if any, as per Form 234, to be<br> adjusted against the liability as per Form 231</td>
    <td><input type="text" value="0"/></td>
    </tr>
    
    <tr>
    <td>e) Adjustment of ET paid under Maharashtra Tax on<br> Entry of Goods into Local Areas Act 2002 /Maharashtra<br> Tax on Entry of Motor Vehicle Act into Local Areas Act 1987</td>
    <td><input type="text" value="0"/></td>
    </tr>
    
    <tr>
    <td>e1) Amount of Tax collected at source u/s 31A</td>
    <td><input type="text" value="0"/></td>
    </tr>
    
    <tr>
    <td>f) Refund adjustment order No. (Details to be entered in <br>Box 8 F)</td>
    <td><input type="text" value="0"/></td>
    </tr>
    
    <tr>
    <td>g) Total available credit(a+b+c+d+e+e1+f)</td>
    <td><input type="text" value="0"/></td>
    </tr>
    
    <tr>
    <td><u> B. Total tax payable and adjustment of CST/ET payable <br>against available credit</u></td>
    </tr>
    
    <tr>
    <td>a) Sales Tax payable as per box 4</td>
    <td><input type="text" value="0"/></td>
    </tr>
    
    <tr>
    <td>b) Adjustment on account of MVAT payable, if any as per<br> Return Form 234 against the excess credit<br> as per Form 231</td>
    <td><input type="text" value="0"/></td>
   </tr>
   
   <tr>
   <td>c) Adjustment on account of CST payable as per return<br> for this period</td>
   <td><input type="text" value="0"/></td>
   </tr>
   
   <tr>
   <td>d) Adjustment on account of ET payable under Maharashtra<br> tax on Entry of Goods into Local Areas Act, 2002 / Mharashtra<br> Tax on Entry of Motor Vehicle Act into Local Areas Act 1987</td>
   <td><input type="text" value="0"/></td>
   </tr>
   
   <tr>
   <td>e) Amount of Tax Collected in Excess of the amount <br>of Sales Tax payable if any(as per Box 6A)</td>
   <td><input type="text" value="0"/></td>
   </tr>
   
   <tr>
   <td>f) Interest Payable</td>
   <td><input type="text" value="0"/></td>
   </tr>
   
   <tr>
   <td>f1) Late Fee Payable</td>
   <td><input type="text" value="0"/></td>
   </tr>
   
   <tr>
   <td>g) Balance Excess credit= [8A(g)-(8B(a)+8B(b)<br>+8B(c)+8B(d)+8B(e)+8B(f)+8B(f1))]</td>
    <td><input type="text" value="0"/></td>
   </tr>
   
   <tr>
   <td>h) Balance Amount payable= [8B(a)+8B(b)+8B(c)<br>+8B(d)+8B(e)+8B(f)+8B(f1)-8B(g)]</td>
   <td><input type="text" value="0"/></td>
   </tr>
   
   <tr>
   <td><u>C. Utilisation of Excess Credit as per box 8B(g)</u></td>
   </tr>
   
   <tr>
   <td>a) Excess credit carried forward to subsequent tax period</td>
   <td><input type="text" value="0"/></td>
   </tr>
   
   <tr>
   <td>b) Excess credit claimed as refund in this<br> return(Box 8B(g)-Box 8C(a))</td>
   <td><input type="text" value="0"/></td>
   </tr>
   
   <tr>
   <td><u>D. Tax payable with return-Cum-Chalan</u></td>
   </tr>
   
   <tr>
   <td>a) Total Amount payable as per Box 8B(h)</td>
   <td><input type="text" value="0"/></td>
   </tr>
   
   <tr><td align="center"><input type="submit" value="Save"/></td></tr>
    </table>
    </div>
    </div>
    
    <div class="tabContent" id="amount">
   <div>
   8 E.
   <TABLE ID="tbl3" border="1" align="center" STYLE="border width:1 orange dashed;background color:#F0E68C;table-row width:4;">
<TR><TH>Sr. NO.</TH>
<TH WIDTH="70">Chalan CIN NO.</TH>
<TH WIDTH="150">Amount (Rs.)</TH>
<TH WIDTH="80">Payment Date</TH>
<TH WIDTH="230">Name of Bank</TH>
<TH WIDTH="230">Branch Name</TH>
<TD ALIGN="center"><INPUT TYPE="Button" onClick="addRow1('tbl3')" VALUE="Add Row"></TD></TR>

</TABLE>
    <table align="center">
    <tr>
    <td><input type="submit" value="Total Amount"></td>
    <td><input type="text" value="0"></td>
    </tr>
    <tr>
    <td><input type="submit" value="Save"></td>
    
    </tr>
    </table>
   </div>
   </div> 
   
   <div class="tabContent" id="rao">
   <div>
   8 F.
   <TABLE ID="tbl4" border="1" align="center" STYLE="border width:2 orange dashed;background color:#F0E68C;table-row width:6;">
<TR><TH>Sr. NO.</TH>
<TH WIDTH="70">RAO No.</TH>
<TH WIDTH="230">Amount Adjusted (Rs.)</TH>
<TH WIDTH="70">Date of RAO</TH>
<TD ALIGN="center"><INPUT TYPE="Button" onClick="addRow2('tbl4')" VALUE="Add Row"></TD></TR>

</TABLE>
    <table align="center">
    <tr>
    <td><input type="submit" value="Total Amount"></td>
    <td><input type="text" value="0"></td>
    </tr>
    <tr>
    <td><input type="submit" value="Save"></td>
    
    </tr>
    
    </table>
   </div>
   </div> 
   
   <div class="tabContent" id="declare">
   <div>
   <table cellspacing=8>
   <tr>
   <td>8 G.</td>
   </tr>
   
   <tr>
   <td>Date of Filling of Return:</td>
   </tr>
   
   <tr>
   <td>Date:</td>
   <td><input type="text" /></td>
   </tr>
   
   <tr>
   <td>Place:</td>
   <td><input type="text" /></td>
   </tr>
   
   <tr>
   <td>Name of Authorized Person:</td>
   <td><input type="text" /></td>
   </tr>
   
   <tr>
   <td>Designation:</td>
   <td><input type="text" /></td>
   </tr>
   
   <tr>
   <td>Email id:</td>
   <td><input type="text" /></td>
   </tr>
   
   <tr>
   <td>Mobile no.:</td>
    <td><input type="text" /></td>
   </tr>
   
   <tr>
   <td>Remark:</td>
   <td><input type="text" /></td>
   </tr>
      </table>
      <table>
      <tr>
    <td><input type="submit" value="Save"></td>
    
    </tr>
    </table>
   </div>
   </div> 
    
     
</body>
       </html>